#ifndef HIERARCHICALBUNDLEDOCKWIDGET_H
#define HIERARCHICALBUNDLEDOCKWIDGET_H

#include <QDockWidget>
#include <vtkHierarchicalGraphView.h>
#include <functionalnetwork.h>
#include <vtkTreeLayoutStrategy.h>
#include <vtkViewTheme.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkDoubleArray.h>
#include <vtkStringArray.h>
#include <vtkEventQtSlotConnect.h>
#include <vtkSelectionNode.h>
#include <vtkDataRepresentation.h>
#include <views/abstractView.h>
#include <vtkXMLTreeReader.h>
#include <vtkSelection.h>
#include <vtkTable.h>
#include <vtkTableToGraph.h>
#include <vtkIdTypeArray.h>
#include <vtkDataSetAttributes.h>
#include <QDir>
#include <vtkActorCollection.h>

namespace Ui {
    class HierarchicalBundleView;
}

class HierarchicalBundleView : public AbstractView {
    Q_OBJECT

private slots:
	void graphSelectionChanged(vtkObject *, unsigned long, void*,void*);
	void bundleStrengthChanged(double);

public:
    HierarchicalBundleView(QWidget *parent = 0);
    ~HierarchicalBundleView();

	void setNetwork(FunctionalNetwork *n);

protected:
    void changeEvent(QEvent *e);
    virtual void updateSelection();
	void updateView();

protected slots:
	virtual void on_matrixChanged();

private slots:
	void on_selectionChanged(vtkObject* caller, unsigned long vtk_event, void* client_data, void* call_data);


private:
    void updateGraph();
    Ui::HierarchicalBundleView *ui;

    vtkHierarchicalGraphView *view;
	vtkXMLTreeReader *reader1;
	vtkXMLTreeReader *reader2;
	vtkTreeLayoutStrategy *layout;
	vtkTable *table;
	vtkTableToGraph *table2Graph;
	vtkIntArray *id1Array;
	vtkIntArray *id2Array;
	vtkDoubleArray *corrArray;

	vtkEventQtSlotConnect *qVTKslot;
    vtkRenderer *renderer;
};

#endif // HIERARCHICALBUNDLEDOCKWIDGET_H
